package org.langcom;

import java.math.BigDecimal;

public class ValidationUtils {

	public static boolean isNullAny(Object... values) {
		for (Object value : values) {
			if (value == null) {
				return true;
			}
		}
		return false;
	}

	public static void assertNotNullNorZeroNorLess(BigDecimal... numbers) {
		for (BigDecimal number : numbers) {
			if (number == null || number.compareTo(BigDecimal.ZERO) <= 0) {
				throw new IllegalArgumentException(Messages.ValidationUtils_MUST_NOT_BE_NULL_OR_LESS_THAN_ZERO);
			}
		}
	}

	public static boolean moreThanZero(BigDecimal number) {
		return number.compareTo(BigDecimal.ZERO) > 0;
	}

	public static void assertNotNull(Object... values) {
		for (Object value : values) {
			if (value == null) {
				throw new IllegalArgumentException(Messages.ValidationUtils_MUST_NOT_BE_NULL);
			}
		}
	}

}
